COMPILER = armv5-linux-
#COMPILER = cortex_a8-linux-

CC = $(COMPILER)gcc

LINK += -lpthread
LINK += -ldl
LINK += -lm

BUILD = ./obj

debuge = -DUART_TEST

INC +=  -I./inc

#target = uart_test
target = S2N
SRC =  $(BUILD)/main.o 
SRC += $(BUILD)/linklist.o 
SRC += $(BUILD)/cJSON.o 
SRC += $(BUILD)/comm.o 
SRC += $(BUILD)/uart.o 
SRC += $(BUILD)/thread.o 



OBJ = 

all:$(SRC)
	$(CC) -o $(target) $(SRC) $(LIB)  $(INC)   $(LINK) 

test:$(SRC)
	$(CC) -c main.c  $(INC)  $(debuge)
	$(CC) -o uart_test $(SRC) $(LIB)  $(INC)   $(LINK) 


$(BUILD)/%.o:%.c
	$(CC) -c $<	$(INC) -o $@

$(BUILD)/%.o:./src/%.c
	$(CC) -c $< $(INC) -o $@



clean:
	rm -rf *.o $(target)

.PHONY: clean
